/**
 * 广寒宫
 * 网址:www.guanghangong.xyz
 */
package org.moon.framework.autoconfigure.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 包含审计信息的基础类实体
 * @author moon
 */
@Getter
@Setter
public class BaseEntity implements Serializable{

    private static final long serialVersionUID = 7448192249998984653L;

    @TableId(type=IdType.AUTO)
	private Integer id;

	@ApiModelProperty(value = "状态（0正常 1删除）",allowableValues = "0,1",hidden = true)
    @TableLogic
    @JsonIgnore
    private Integer deleted;
    
	@ApiModelProperty(value = "创建者",hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Integer createBy;
    
	@ApiModelProperty(value = "创建者所在部门",hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Integer createDept;

	@ApiModelProperty(value = "创建时间",hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新者",hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateBy;

	@ApiModelProperty(value = "更新时间",hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}